﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;
using Peak.Core;

namespace Peak.Data.NHibernateMaps
{
  public class TaskChangeMap : IAutoMappingOverride<TaskChange>
  {
    public void Override(AutoMapping<TaskChange> mapping)
    {
      mapping.Id(x => x.Id, "id").UnsavedValue(0).GeneratedBy.Identity();
      mapping.Map(x => x.Date);
      mapping.Map(x => x.NewValue);
      mapping.Map(x => x.OldValue);
      mapping.Map(x => x.Type).CustomType(typeof(TaskChangeType)).Not.Nullable(); ;      
    }
  }
}